home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
wdj0797.zip
/
TUFFS.ZIP
/
EXCEPT2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-24
|
536b
|
24 lines
#include <iostream.h>
#include <except.h>
#include <cstring.h>
#include "warning.h"
void badFunction(){
char* p = 0;
cout << "The character at " << p << " is " << *p << endl;
}
int main(){
IssueWarning();
try {
cout << "Calling badFunction()" << endl;
badFunction();
cout << "badFunction() completed, no exception" << endl;
} catch (xmsg &x) {
cerr << "Exception caught '" << x.why() << "'" << endl;
} catch (...) {
cerr << "Unknown exception caught" << endl;
}
return 0;
}